package com.hzit.mmcb.core.controller.admin;


import com.hzit.common.result.R;
import com.hzit.mmcb.core.pojo.entity.UserLoginRecord;
import com.hzit.mmcb.core.service.UserLoginRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 用户登录记录表 前端控制器
 * </p>
 *
 * @author ljh
 * @since 2024-08-27
 */
@RestController
@RequestMapping("/admin/core/userLoginRecord")
@Api(tags = "用户日志")
public class AdminUserLoginRecordController {

    @Autowired
    private UserLoginRecordService userLoginRecordService;

    @ApiOperation("查询用户日志")
    @GetMapping("/listById/{id}")
    public R listById(@PathVariable @ApiParam(value = "用户id",required = true) Long id){
        List<UserLoginRecord> records =userLoginRecordService.listById(id);
        return R.ok().data("list",records);
    }

}

